<!--
 * @Author: your name
 * @Date: 2020-12-18 16:42:15
 * @LastEditTime: 2020-12-18 16:52:49
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \basicjs\kongjian\gundong.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>滚动文档</title>
    <style>
        body{
            height: 3000px;
        }
    </style>
</head>
<body>
    <script type="module">
        // setInterval(() => {
        //     document.documentElement.scrollBy({
        //         top:30,
        //         behavior:'smooth'
        //     });
        // },100);


        //使用scroll滚动到指定位置
        setTimeout(() => {
            document.documentElement.scroll({top:100,behavior:'smooth'});
        },1000);
    </script>
</body>
</html>
